import Request from 'luch-request';
import type { HttpRequestConfig } from 'luch-request';
import baseUrl from './baseUrl';
const http = new Request({
	baseURL: baseUrl,
	timeout: 300000, //超时时长5分钟,
	header: {
		'Content-Type': 'application/x-www-form-urlencoded',
	},
});
/** 请求拦截器 */
http.interceptors.request.use(
	(config: HttpRequestConfig) => {
		return config;
	},
	(error) => {
		return Promise.resolve(error);
	}
);
http.interceptors.response.use(
	(response) => {
		return response;
	},
	(error) => {
		return Promise.resolve(error);
	}
);
export default http;
